package com.qi.spzx.manager.mapper;

import com.qi.spzx.model.dto.system.SysRoleDto;
import com.qi.spzx.model.entity.system.SysRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @Description TODO
 * @Author dingchunlin
 * @Date 2024/2/21 19:14
 * @Version 1.0.0
 */
@Mapper
public interface SysRoleMapper {
    List<SysRole> findByPage(SysRoleDto sysRoleDto);

    void saveRole(SysRole sysRole);

    @Update("update sys_role set is_deleted = 0 where id = #{id}")
    void deleteRole(Long id);

    void updateRole(SysRole sysRole);

    @Select("select * from sys_role where is_deleted = 1")
    List<SysRole> findAllRoles();

}
